﻿<%@ Page Title="" Language="C#" MasterPageFile="~/User/User.Master" ClientIDMode="Static" AutoEventWireup="true" CodeBehind="Organization.aspx.cs" Inherits="CoolERP_Web.User.Organization" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td class="tbHead_L"></td>
            <td class="tbHead_M"><div><b>组织结构管理</b></div></td>
            <td class="tbHead_R"></td>
        </tr>
        <tr>
            <td class="tbBody_L"></td>
            <td class="tbBody_M">
                <table width="100%" border="0">
                    <tr>
                        <td valign="top" style="border: solid 1px #00CC00; background-color: White; width: 300px;color: #528311">
                            <asp:TreeView ID="tvZZJG" runat="server" AutoGenerateDataBindings="False" ExpandDepth="0"
                                Height="90%" OnSelectedNodeChanged="tvZZJG_SelectedNodeChanged">
                                <SelectedNodeStyle Font-Bold="true" />
                                <NodeStyle ForeColor="#528311" />
                            </asp:TreeView>
                        </td>
                        <td valign="top" style="padding-left: 30px">
                            <ul class="tags">
                                <li class="liLeft"><asp:Label ID="LabelTableName" runat="server" Text=""></asp:Label></li>
                                <li class="selTag" onclick="selTag(this);"><div><asp:LinkButton ID="LinkButton1" Text="下属组织结构" runat="server" CommandArgument="0"
                                        OnCommand="LinkButton_Command" CausesValidation=false /></div></li>
                                <li onclick="selTag(this);"><div><asp:LinkButton ID="LinkButton2" Text="组织结构人员" runat="server" CommandArgument="1"
                                        OnCommand="LinkButton_Command" OnClientClick="return " CausesValidation=false /></div></li>
                                <li class="liRight"><asp:ImageButton ID="ImageButtonAdd" runat="server" ImageUrl="~/Images/Common/btn_add0.png" OnClick="AddImageButton_Click" /></li>
                            </ul>
                            <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                <ContentTemplate>
                                    <asp:GridView ID="GridView1" DataKeyNames="Id" Width="100%" runat="server" CssClass="grvCSS" AutoGenerateColumns="False" AllowPaging="True"
                                        PageSize="20" OnRowDataBound="GridView1_RowDataBound" OnRowDeleting="GridView1_RowDeleting" OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating" OnRowCancelingEdit="GridView1_RowCancelingEdit"
                                        Visible="False">
                                        <Columns>
                                            <asp:TemplateField HeaderText="部门编号">
                                                <ItemTemplate><%# Eval("Code")%></ItemTemplate>
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="txtCode" runat="server" Text='<%# Eval("Code")%>' MaxLength="2" Width=30px onkeyup='txtLimit(this,0)'></asp:TextBox>
                                                    <span style="color: #FF0000">*<asp:RequiredFieldValidator ID="RequiredFieldValidator0" runat="server"
                                                        ControlToValidate="txtCode" Display="Dynamic" ErrorMessage="请输入2位数字" ForeColor="Red"/></span>
                                                </EditItemTemplate>
                                                <FooterTemplate>
                                                    <asp:TextBox ID="txtCode" runat="server" MaxLength="2" Width=30px onkeyup='txtLimit(this,0)'></asp:TextBox>
                                                    <span style="color: #FF0000">*<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
                                                        ControlToValidate="txtCode" Display="Dynamic" ErrorMessage="请输入2位数字" ForeColor="Red"/></span>
                                                </FooterTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="部门名称">
                                                <ItemTemplate><%# Eval("Name")%></ItemTemplate>
                                                <EditItemTemplate><asp:TextBox ID="txtName" runat="server" Text='<%# Eval("Name")%>' />
                                                    <span style="color: #FF0000">*<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
                                                        ControlToValidate="txtName" Display="Dynamic" ErrorMessage="请输入部门名称" ForeColor="Red"/></span>
                                                </EditItemTemplate>
                                                <FooterTemplate>
                                                    <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                                                    <span style="color: #FF0000">*<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"
                                                        ControlToValidate="txtName" Display="Dynamic" ErrorMessage="请输入部门名称" ForeColor="Red"/></span>
                                                </FooterTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="部门职能">
                                                <ItemTemplate><asp:Literal ID="liZN" runat=server></asp:Literal></ItemTemplate>
                                                <EditItemTemplate><asp:DropDownList runat=server ID="ddlZN"/></EditItemTemplate>
                                                <FooterTemplate><asp:DropDownList runat=server ID="ddlZN"/></FooterTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="部门备注">
                                                <ItemTemplate><%# Eval("Description")%></ItemTemplate>
                                                <EditItemTemplate><asp:TextBox ID="txtDescription" runat="server" Text='<%# Eval("Description")%>'/></EditItemTemplate>
                                                <FooterTemplate><asp:TextBox ID="txtDescription" runat="server"></asp:TextBox></FooterTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField ShowHeader="False">
                                                <ItemTemplate>
                                                    <asp:ImageButton ID="btnEdit" runat="server" ImageUrl="~/Images/Common/btn_edit0.png" CommandName="Edit" />&nbsp;
                                                    <asp:ImageButton ID="btnDelete" runat="server" ImageUrl="~/Images/Common/btn_del0.png" CommandName="Delete" /></ItemTemplate>
                                                <EditItemTemplate>
                                                    <asp:ImageButton ID="btnSave" runat="server" ImageUrl="~/Images/Common/btn_save0.png" CommandName="Update" />&nbsp;
                                                    <asp:ImageButton ID="btnCancel" runat="server" ImageUrl="~/Images/Common/btn_cancel0.png" CommandName="Cancel" CausesValidation=false />
                                                </EditItemTemplate>
                                                <FooterTemplate>
                                                    <asp:ImageButton ID="btnSave" runat="server" ImageUrl="~/Images/Common/btn_save0.png" OnClick="btnSave_Click" />&nbsp;
                                                    <asp:ImageButton ID="btnCancel" runat="server" ImageUrl="~/Images/Common/btn_cancel0.png" OnClick="btnCancel_Click" CausesValidation="false" />
                                                </FooterTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                        <PagerSettings Visible="false" />
                                    </asp:GridView>
                                    <asp:GridView ID="GridView2" DataKeyNames="Id" Width="100%" runat="server" CssClass="grvCSS" AutoGenerateColumns="False" AllowPaging="True"
                                        PageSize="20" OnRowDeleting="GridView2_RowDeleting" Visible="False">
                                        <Columns>
                                            <asp:BoundField DataField="Code" HeaderText="员工编号" ReadOnly="true" />
                                            <asp:BoundField DataField="Name" HeaderText="姓名" />
                                            <asp:TemplateField HeaderText="性别">
                                                <ItemTemplate><%# Eval("Gender") == "0" ? "女" : "男" %></ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="操作">
                                                <ItemTemplate>
                                                    <a href="User_Edit.aspx?id=<%# Eval("Id") %>&depId=<%=nowDepartmentId %>"><img src="../Images/Common/btn_edit0.png" border=0 /></a>&nbsp;
                                                    <asp:ImageButton ID="btnDelete" runat="server" ImageUrl="~/Images/Common/btn_del0.png" CommandName="Delete" />
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                        <PagerSettings Visible="false" />
                                    </asp:GridView>
                                    <webdiyer:AspNetPager ID="AspNetPager1" runat="server" AlwaysShow="True" CssClass="pager"
                                        UrlPaging="false" ShowCustomInfoSection="Left" FirstPageText="首页" LastPageText="尾页"
                                        PrevPageText="前页" NextPageText="后页" OnPageChanged="AspNetPager1_PageChanged"
                                        TextAfterPageIndexBox="页" TextBeforePageIndexBox="转到" PageIndexBoxType="TextBox"
                                        ShowPageIndexBox="Always" SubmitButtonText="Go" CustomInfoHTML="共%RecordCount%条数据，每页%PageSize%条，共%PageCount%页，当前为第%CurrentPageIndex%页">
                                    </webdiyer:AspNetPager>
                                    <asp:Panel ID="panMsg" runat="server" ClientIDMode="Static" CssClass="msg24_attention" Visible="false">无相关记录</asp:Panel>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="AspNetPager1" EventName="PageChanged" />
                                    <asp:AsyncPostBackTrigger ControlID="LinkButton1" EventName="Command" />
                                    <asp:AsyncPostBackTrigger ControlID="LinkButton2" EventName="Command" />
                                    <asp:AsyncPostBackTrigger ControlID="ImageButtonAdd" EventName="Click" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                </table>
            </td>
            <td class="tbBody_R"></td>
        </tr>
        <tr>
            <td class="tbFoot_L"></td>
            <td class="tbFoot_M"></td>
            <td class="tbFoot_R"></td>
        </tr>
    </table>
</asp:Content>
